//
//  ZYCCicleFriendsPlainDetailTextView.m
//  ZDSC
//
//  Created by ZDTX on 2021/9/19.
//

#import "ZYCCicleFriendsPlainDetailTextView.h"
#import "ZYCCycleFriendModel.h"
@interface ZYCCicleFriendsPlainDetailTextView ()

@property (nonatomic, strong) UITextView *contentTextView;
@property (nonatomic, strong) UILabel *titleLabel;

@end
@implementation ZYCCicleFriendsPlainDetailTextView

- (void)setModel:(ZYCCycleFriendModel *)model{
    _model = model;
    _contentTextView.text = model.content;
    _titleLabel.text = [NSString stringWithFormat:@"发布人:%@",model.uploadUserName];
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.contentTextView];
        [self addSubview:self.titleLabel];
        
        [self.contentTextView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(15.0f);
            make.right.equalTo(self).offset(-15.0f);
            make.top.equalTo(self);
            make.bottom.equalTo(self.titleLabel.mas_top).offset(-10.0f);
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(10.0f);
            make.bottom.equalTo(self).offset(-25.0f);
        }];

    }
    return self;
}

- (UITextView *)contentTextView {
    if (!_contentTextView) {
        _contentTextView = [[UITextView alloc] init];
        _contentTextView.editable = NO;
        _contentTextView.font = kCustomFont(@"PingFangSC-Regular", 15.0f);
        _contentTextView.textColor = HEX_RGB(@"#2B302D");
    }
    return _contentTextView;
}

- (UILabel *)titleLabel {
    if (!_titleLabel) {
        _titleLabel = [UILabel LabelWithFont:kCustomFont(@"PingFangSC-Regular", 13.0f) titleColor:HEX_RGB(@"#2B302D") textAlignment:ZZTextAlignmentLeft];
    }
    return _titleLabel;
}
@end
